url.js ➔ ... ➔ it(ꞌconfiguration fileꞌ)   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
c 0
b 0
f 0
nc 2
dl 0
loc 5
rs 9.4285
nop 0
1
var chai = require('chai');
2
var path = require('path');
3
4
var coreUtils = require('../src/cli').coreUtils
5
var fse = require('fs-extra')
6
var config = require('../src/cli').config
7
config.set({root: path.join(__dirname,'fixtures')})
8
9
describe('Url', function() {
10
11
  var urls = fse.readJsonSync(path.join(__dirname, 'fixtures', 'string', 'urls.json'), 'utf8')
12
13
  /**
14
   * getAbeImport
15
   * 
16
   */
17
  it('configuration file', function() {
18
    for(var key in urls){
0 ignored issues
show
Complexity introduced by
A for in loop automatically includes the property of any prototype object, consider checking the key using hasOwnProperty.

When iterating over the keys of an object, this includes not only the keys of the object, but also keys contained in the prototype of that object. It is generally a best practice to check for these keys specifically:

var someObject;
for (var key in someObject) {
    if ( ! someObject.hasOwnProperty(key)) {
        continue; // Skip keys from the prototype.
    }

    doSomethingWith(key);
}
Loading history...
19
      chai.assert.equal(coreUtils.slug.clean(key), urls[key] + config.files.templates.extension, key + 'slugified url did not match')
20
    }
21
  });
22
23
});
24